<template>
    <div>
        <a-modal
            title="打印教学评估调查结果"
            :visible="visible"
            @ok="visible = false"
            @cancel="visible = false"
            :footer="null"
            class="reimbursement-totalPrint-modal"
            :width="794+48+30"
        >
            <div style="margin: 15px;">
                <div>
                    <a-button class="blue-btn" type="primary" v-print="printObj">打印</a-button>
                </div>
                <div  id="surveyResults-id" style="width: 100%;">
                    <div class="surveyResults-content-table-v">
                        <div style="width: 100%;">
                            <div
                            style="
                            font-family: 'fangzhengxiaobiao' !important;
                            font-size: 22px;
                            font-weight: 600;
                            text-align: center;"
                            >教学评估调查结果</div>
                            <div class="surveyResults-table-top">
                                <div class="table-top-item">
                                    <span style="font-weight: 600;">&ensp;培训班名称：</span>
                                    <span>{{ surveyResultsData.px.pxbmc }}</span>
                                </div>
                                <div class="table-top-item">
                                    <span>&ensp;培训起止时间：</span>
                                    <span>{{ surveyResultsData.px.pxsj }}</span>
                                </div>
                                <div class="table-top-item">
                                    <span>&ensp;应参加评价</span>
                                    <span>&nbsp;{{ surveyResultsData.px.ycjpjrs }}&nbsp;人</span>
                                </div>
                                <div class="table-top-item">
                                    <span>&ensp;实际参加评价</span>
                                    <span>&nbsp;{{ surveyResultsData.px.sjcjpjrs }}&nbsp;人</span>
                                </div>
                                <div class="table-top-item">
                                    <span>&ensp;评价率</span>
                                    <span>&nbsp;{{ surveyResultsData.px.pjl }}</span>
                                </div>
                            </div>
                        </div>
                        <table border="1" borderColor="#000" cellspacing="0" style="width: 100%;">
                            <tr>
                                <th colspan="2">培训评估指标</th>
                                <th >评价内容及程度</th>
                                <th style="width: 40px;">满意</th>
                                <th style="width: 40px;">一般</th>
                                <th style="width: 52px;">不满意</th>
                            </tr>
                            <tr v-for="(item,index) in surveyResultsXxList" :key="index">
                                <td v-if="item.tIndex == 0"
                                :rowspan='item.list.length' 
                                style="width: 65px !important;text-align: center;">
                                {{ item.type }}
                                </td>
                                <td v-if="item.tIndex == 0" style="width: 137px;">{{ item.fpgbt }}</td>
                                <td v-if="item.tIndex == 0">{{ item.fpgnr }}</td>
                                <td v-if="item.tIndex == 0" style="text-align: center;">{{ item.my }}</td>
                                <td v-if="item.tIndex == 0" style="text-align: center;">{{ item.yb }}</td>
                                <td v-if="item.tIndex == 0" style="text-align: center;">{{ item.bmy }}</td>
                                
                                <td v-if="item.tIndex !== 0">{{ item.fpgbt }}</td>
                                <td v-if="item.tIndex !== 0">{{ item.fpgnr }}</td>
                                <td v-if="item.tIndex !== 0" style="text-align: center;">{{ item.my }}</td>
                                <td v-if="item.tIndex !== 0" style="text-align: center;">{{ item.yb }}</td>
                                <td v-if="item.tIndex !== 0" style="text-align: center;">{{ item.bmy }}</td>
                            </tr>
                        </table>
                        <table border="1" borderColor="#000" cellspacing="0" style="width: calc(100%);">
                            <tr style="border-top: 1px solid #fff;">
                                <td :rowspan="surveyResultsData.jsjxpjList.length+1" style="width: 65px !important;text-align: center;">教师教学评价</td>
                                <td style="width: 50px;text-align: center;">
                                    <div style="display: flex;justify-content: space-between;">
                                        <span>姓</span>
                                        <span>名</span>
                                    </div>
                                </td>
                                <td style="width: 87px;text-align: center;">教学时间</td>
                                <td style="text-align: center;">教学内容</td>
                                <td style="text-align: center;">教学态度</td>
                                <td style="text-align: center;">教学内容针对性</td>
                                <td style="text-align: center;">教学技巧与方法</td>
                                <td style="text-align: center;">讲解突出重点难点</td>
                                <td colspan="3" style="text-align: center;">教学效果</td>
                            </tr>
                            <tr v-for="(item,index) in surveyResultsJsjxpjList" :key="index">
                                <td v-if="item.tIndex == 0" :rowspan="item.pxnrList.length">
                                    <div v-if="item.name && item.name.length == 2" style="display: flex;justify-content: space-between;">
                                        <span v-for="(trem,aIndex) in item.name.split('')" :key="aIndex">{{ trem }}</span>
                                    </div>
                                    <span v-else>{{ item.name }}</span>
                                </td>
                                <td v-if="item.tIndex == 0">{{ item.pxsj }}</td>
                                <td v-if="item.tIndex == 0">{{ item.jxnr }}</td>
                                <td v-if="item.tIndex == 0" :rowspan="item.pxnrList.length">
                                    <div style="text-align: center;">
                                        <span v-if="item.pjnr.fjxtd" v-for="(a,i) in item.pjnr.fjxtd.split('@')">
                                            <br v-if="i" />
                                            <span>{{ a.replace(a.replace(/[\u4e00-\u9fa5]/g, ''), "") }}</span>
                                            <br/>
                                            <span>{{ a.replace(/[\u4e00-\u9fa5]/g, '') }}</span>
                                            
                                        </span>
                                    </div>
                                </td>
                                <td v-if="item.tIndex == 0" :rowspan="item.pxnrList.length">
                                    <div style="text-align: center;">
                                        <span v-if="item.pjnr.fjxnrzdx" v-for="(a,i) in item.pjnr.fjxnrzdx.split('@')">
                                            <br v-if="i" />
                                            <span>{{ a.replace(a.replace(/[\u4e00-\u9fa5]/g, ''), "") }}</span>
                                            <br/>
                                            <span>{{ a.replace(/[\u4e00-\u9fa5]/g, '') }}</span>
                                        </span>
                                    </div>
                                </td>
                                <td v-if="item.tIndex == 0" :rowspan="item.pxnrList.length">
                                    <div style="text-align: center;">
                                        <span v-if="item.pjnr.fjxjqyff" v-for="(a,i) in item.pjnr.fjxjqyff.split('@')">
                                            <br v-if="i" />
                                            <span>{{ a.replace(a.replace(/[\u4e00-\u9fa5]/g, ''), "") }}</span>
                                            <br/>
                                            <span>{{ a.replace(/[\u4e00-\u9fa5]/g, '') }}</span>
                                            
                                        </span>
                                    </div>
                                </td>
                                <td v-if="item.tIndex == 0" :rowspan="item.pxnrList.length">
                                    <div style="text-align: center;">
                                        <span v-if="item.pjnr.fjjtczdnd" v-for="(a,i) in item.pjnr.fjjtczdnd.split('@')">
                                            <br v-if="i" />
                                            <span>{{ a.replace(a.replace(/[\u4e00-\u9fa5]/g, ''), "") }}</span>
                                            <br/>
                                            <span>{{ a.replace(/[\u4e00-\u9fa5]/g, '') }}</span>
                                            
                                        </span>
                                    </div>
                                </td>
                                <td v-if="item.tIndex == 0" :rowspan="item.pxnrList.length" colspan="3">
                                    <div style="text-align: center;">
                                        <span v-if="item.pjnr.fjxxg" v-for="(a,i) in item.pjnr.fjxxg.split('@')">
                                            <br v-if="i" />
                                            <span>{{ a.replace(a.replace(/[\u4e00-\u9fa5]/g, ''), "") }}</span>
                                            <br/>
                                            <span>{{ a.replace(/[\u4e00-\u9fa5]/g, '') }}</span>
                                            
                                        </span>
                                    </div>
                                </td>

                                <td v-if="item.tIndex !== 0">{{ item.pxsj }}</td>
                                <td v-if="item.tIndex !== 0">{{ item.jxnr }}</td>
                            </tr>
                        </table>
                    </div>
                </div>
            </div>
        </a-modal>
    </div>
</template>
<script>
export default {
    components:{

    },
    props:{

    },
    data(){
        return{
            visible:false,
            surveyResultsData:[],
            surveyResultsJsjxpjList:[],
            surveyResultsXxList:[],
            printObj:{
                id:"surveyResults-id", //需要打印的id名称
                popTitle:"打印教学评估调查结果",//文档的名称
                // preview:true,//预览功能，不好用
                zIndex:'20002',
                beforeOpenCallback(vue){
                    //console.log('打印回调',vue)
                },
                openCallback (vue) {//打开之前
                    //console.log('打开之前',vue)
                },
                closeCallback (vue) {//关闭了打印工具
                    //console.log('关闭了打印工具')
                },
            },
        }
    },
    watch:{

    },
    mounted(){
        
    },
    methods:{
        getData(surveyResultsData,surveyResultsJsjxpjList,surveyResultsXxList){
            this.surveyResultsData = surveyResultsData
            this.surveyResultsJsjxpjList = surveyResultsJsjxpjList
            this.surveyResultsXxList = surveyResultsXxList
        },
        printClick(){

        }
    }
}
</script>
<style lang="less">
.surveyResults-content-table-v{
        width: 100%;
        // font-family: '宋体' !important;
        .surveyResults-table-top{
            .table-top-item{
                color: #000;
                span:nth-child(1){
                    font-weight: 600;
                }
            }
        }
        th,td{
            padding: 0 3px;
            color: #000;
            font-family: '宋体' !important;
            font-size: 14px !important;
        }
        th{
            text-align: center;
            font-weight: 600;
        }
        .table-th-td-ys{
            text-align: center !important;
            font-weight: 600 !important;
        }
    }
@media print{
    .surveyResults-content-table-v{
        width: 100%;
        .surveyResults-table-top{
            .table-top-item{
                color: #000;
                span:nth-child(1){
                    font-weight: 600;
                }
                span:nth-child(2){
                    font-family: '宋体' !important;
                }
            }
        }
        th,td{
            padding: 0 3px;
            font-size: 14px !important;
            
        }
        td{
            font-family: '宋体' !important;
            color: #000;
        }
        th{
            text-align: center;
        }
    }

}

</style>